import type {PageInfo} from "plus-pro-components";
import type {Ref} from "vue";

export const handlePaginationChange = (pageInfo: Ref<PageInfo>, _pageInfo: PageInfo, totalTableData: Ref<any[]>, tableData: Ref<any[]>): void => {
    pageInfo.value = _pageInfo
    let page = _pageInfo.page
    let pageSize = _pageInfo.pageSize
    const startIndex = (page - 1) * pageSize;
    const endIndex = startIndex + pageSize;
    tableData.value = totalTableData.value.slice(startIndex, endIndex);
}